﻿var msetting = {
    //弹窗弹出
    dialogInit: function () {
        var d = manage.dialog({
            title: "全局设置",
            iconCls: "icon-computer-keyboard",
            width: 600,
            href: "/manage/setting/page",
            handler: function () {
                manage.form({
                    dialog: d, formid: "#msetting-form",
                    url: "/manage/setting/global",
                    success: function (result) { }
                });
            },
            onLoad: function () { msetting.formInit(); },
            onClose: function () { UE.getEditor('msetting-copyright').destroy(); }
        });
    },
    //弹窗初始化
    formInit: function () {
        $("#msetting-defrole").combobox({
            required: true,
            editable: false,
            url: "/manage/role/allgrid",
            valueField: "ID", textField: "Name"
        });

        var editor = UE.getEditor('msetting-copyright', {
            snapscreenHost: "127.0.0.1",
            compressSide: 1,
            catchRemoteImageEnable: !0,
            catchFieldName: "imgurl",
            toolbars: [
                ["source", "|", "undo", "redo", "|", "fontfamily", "fontsize", "|", "blockquote", "horizontal", "removeformat", "formatmatch", "link", "unlink", "|", "insertvideo", "music", "insertimage", "drafts"],
                ["bold", "italic", "underline", "forecolor", "backcolor", "|", "justifyleft", "justifycenter", "justifyright", "|", "rowspacingtop", "rowspacingbottom", "lineheight", "|", "insertorderedlist", "insertunorderedlist", "|", "imagenone", "imageleft", "imageright", "imagecenter"]
            ],
            labelMap: { anchor: "", undo: "" },
            //默认的编辑区域宽度
            initialFrameWidth: "100%",
            //默认的编辑区域高度
            initialFrameHeight: 150,
            //开启滚动条
            scaleEnabled: true,
            //关闭字数统计
            wordCount: false,
            //关闭elementPath
            elementPathEnabled: false
        });
    }
};

$(function () { msetting.dialogInit(); });